package com.ibeetl.admin.console.web.business;

import com.ibeetl.admin.console.service.UserConsoleService;
import com.ibeetl.admin.console.service.business.ScoreDetailService;
import com.ibeetl.admin.console.service.business.ShareDetailService;
import com.ibeetl.admin.console.web.query.business.ScoreDetailsQuery;
import com.ibeetl.admin.console.web.query.business.ShareDetailsQuery;
import com.ibeetl.admin.core.annotation.Function;
import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.entity.business.ScoreDetails;
import com.ibeetl.admin.core.entity.business.ShareDetails;
import com.ibeetl.admin.core.service.CorePlatformService;
import com.ibeetl.admin.core.util.AnnotationUtil;
import com.ibeetl.admin.core.web.JsonResult;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
import java.util.Map;

/**
 * 透镜分详情查询
 * 
 * @author xiandafu
 */
@Controller
public class ShareDetailController {
	private final Log log = LogFactory.getLog(this.getClass());
	private static final String MODEL = "/admin/shareDetails";

	@Autowired
	private ShareDetailService shareDetailService;
	

   

	/* 页面 */

	@GetMapping(MODEL + "/index.do")
	@Function("shareDetails")
	public ModelAndView index() {
		ModelAndView view = new ModelAndView("/admin/business/shareDetails/index.html");
		view.addObject("search", ShareDetailsQuery.class.getName());
		return view;
	}

	@PostMapping(MODEL + "/list.json")
	@Function("shareDetails.query")
	@ResponseBody
	public JsonResult<PageQuery<ShareDetails>> index(ShareDetailsQuery condtion) {

		PageQuery<ShareDetails> page = condtion.getPageQuery();
		shareDetailService.queryByCondtion(page);
		return JsonResult.success(page);
	}

	@PostMapping(MODEL + "/list/condition.json")
	@Function("shareDetails.query")
	@ResponseBody
	public JsonResult<List<Map<String, Object>>> indexCondtion() {
		List<Map<String, Object>> list = AnnotationUtil.getInstance().getAnnotations(Query.class, ShareDetailsQuery.class);
		return JsonResult.success(list);
	}




	
	

}
